package com.example.springsecurity;

import com.example.springsecurity.bean.DO.Users;
import com.example.springsecurity.mapper.UsersMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

@Controller
public class TestController {
  @Autowired
    UsersMapper usersMapper;


    @ResponseBody
    @GetMapping("admin")
    public String admin() {
        return "admin";
    }

    @ResponseBody
    @GetMapping("user")
    public String user() {
        return "user";
    }

    @ResponseBody
    @GetMapping("db")
    public String db() {
        return "db";
    }

    @ResponseBody
    @PostMapping("success")
    public String success() {

        return "success.html";
    }


    @GetMapping("index")
    public String index() {

        return "index.html";
    }

    @ResponseBody
    @PostMapping("fail")
    public String fail() {

        return "fail.html";
    }

/*    @GetMapping("login")
    public String login(){

        return "login.html";
    }*/


    @GetMapping("/testMybaits")
    public String getMybaits() {
        List<Users> users = usersMapper.selectList(null);
        System.out.println(users);
        return "123";
    }


}
